--------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/ericaowen/Box/meta/Data and Analysis/Data Analysis/_Meta pub
>  bias/Replication files/owenli_log.log
  log type:  text
 opened on:  27 Jan 2020, 11:58:36

. 
. // Replication files for "The Conditional Nature of Publication Bias: The Cond
> itional Nature of Publication Bias: A Meta-Regression Analysis" 
.                 // by Erica Owen and Quan Li
. // Date: 1/6/2019
. // File author: Erica Owen (ericaowen@pitt.edu)
. // This do file replicates results in main text
. 
. // Set working directory
. 
. 
. // #0
. // program set-up
. version 13.1

. clear all

. macro drop _all

. set linesize 80

. 
. // Load data
. use "owenli_data.dta", clear

. 
. // Figure 1 
. sum pc_fe  if dvshare==0   & xkey==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       pc_fe |         50    .0297818    .0660471  -.1762303   .1277661

. local mean1 `r(mean)' 

. 
. sum pc_fe  if dvshare==0   & xkey==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       pc_fe |         60    -.026162    .1428626  -.4019367   .2246023

. local mean2 `r(mean)' 

. 
. graph twoway    (scatter precfe pc_fe  if dvshare==0   & xkey==0, msymbol(X) m
> color(red) jitter(7)) ///
>         (scatter precfe pc_fe  if dvshare==0  & xkey==1, msymbol(Oh) mcolor(bl
> ue) jitter(7)), ///
>          name(fun1, replace) /// 
>          xline(`mean1',   lcolor(red)) ///
>          xline(`mean2',   lpattern(dash) lcolor(blue)) ///
>         ytitle("Precision") xtitle("Partial correlation") ///
>         title("") xlabel(-.4(.2).3) ylabel(0(10)60) ///
>         legend(label(1 "Control") label(2 "Key") pos(11) ring(0))  graphregion
> (margin(tiny))

. 
.         
. sum pc_fe  if dvshare==1   & xkey==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       pc_fe |         79    .0182105    .0744915  -.2156705   .2339994

. local mean1 `r(mean)' 

. 
. sum pc_fe  if dvshare==1  & xkey==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       pc_fe |         40    .1268473    .1425102  -.1033874   .4310165

. local mean2 `r(mean)' 

. 
. graph twoway    (scatter precfe pc_fe  if dvshare==1   & xkey==0, msymbol(X) m
> color(red) jitter(7)) ///
>         (scatter precfe pc_fe  if dvshare==1  & xkey==1, msymbol(Oh) mcolor(bl
> ue) jitter(7)), ///
>          name(fun2, replace) /// 
>          xline(`mean1',   lcolor(red)) ///
>          xline(`mean2',   lpattern(dash) lcolor(blue)) ///
>         ytitle("Precision") xtitle("Partial correlation") ///
>         title("") xlabel(-.4(.2).4) ylabel(0(10)60) /// 
>         legend(label(1 "Control") label(2 "Key") pos(11) ring(0)) graphregion(
> margin(tiny))

. 
. 
. // Table 1
. 
. // Models 1-4 
. local c if dvshare==0  

. 
. reg pc_fe sepcfe   `c' [aweight=prfesq], robust
(sum of wgt is   1.0301e+05)

Linear regression                               Number of obs     =        110
                                                F(1, 108)         =      17.32
                                                Prob > F          =     0.0001
                                                R-squared         =     0.1444
                                                Root MSE          =     .07492

------------------------------------------------------------------------------
             |               Robust
       pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      sepcfe |  -2.452841   .5893778    -4.16   0.000     -3.62109   -1.284592
       _cons |   .1056022   .0186592     5.66   0.000     .0686165    .1425879
------------------------------------------------------------------------------

. est sto m1

. 
. local se c.sepcfe##i.xkey

. 
. reg pc_fe   `se'  `c' [aweight=prfesq], robust
(sum of wgt is   1.0301e+05)

Linear regression                               Number of obs     =        110
                                                F(3, 106)         =       7.84
                                                Prob > F          =     0.0001
                                                R-squared         =     0.2389
                                                Root MSE          =     .07132

-------------------------------------------------------------------------------
              |               Robust
        pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
       sepcfe |  -.5001462   .5302737    -0.94   0.348    -1.551465     .551173
              |
         xkey |
         Key  |   .1562705   .0433249     3.61   0.000     .0703747    .2421663
              |
xkey#c.sepcfe |
         Key  |  -4.721196    1.22887    -3.84   0.000     -7.15755   -2.284843
              |
        _cons |   .0563237   .0170535     3.30   0.001     .0225135    .0901339
-------------------------------------------------------------------------------

. est sto m2

. 
. local d  dvlog develop nonpolity   fectry ldv robust gmm sampyr 

. local se c.sepcfe##i.xkey

. local c if dvshare==0  

. 
. reg pc_fe `d' `se'  `c' [aweight=prfesq], robust        
(sum of wgt is   1.0301e+05)

Linear regression                               Number of obs     =        110
                                                F(11, 98)         =      34.88
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7026
                                                Root MSE          =     .04637

-------------------------------------------------------------------------------
              |               Robust
        pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
        dvlog |   .0651927    .016292     4.00   0.000     .0328617    .0975237
      develop |   .0208116   .0151218     1.38   0.172    -.0091972    .0508204
    nonpolity |   .0068662   .0187796     0.37   0.715    -.0304013    .0441338
       fectry |   .0355226   .0175626     2.02   0.046     .0006702    .0703751
          ldv |   .0620522   .0208805     2.97   0.004     .0206154    .1034889
       robust |  -.0335495   .0093147    -3.60   0.000    -.0520342   -.0150647
          gmm |   .1177979   .0514454     2.29   0.024     .0157063    .2198896
      sampyrs |    -.00916    .001277    -7.17   0.000    -.0116941   -.0066259
       sepcfe |  -.6852243   .4188057    -1.64   0.105    -1.516331    .1458819
              |
         xkey |
         Key  |   .1867259   .0507946     3.68   0.000     .0859256    .2875262
              |
xkey#c.sepcfe |
         Key  |  -6.443706   1.097968    -5.87   0.000    -8.622588   -4.264824
              |
        _cons |   .1659929   .0307639     5.40   0.000     .1049431    .2270428
-------------------------------------------------------------------------------

. est sto m3

. 
. 
. local se c.sepcfe##i.xkey year

. local c if dvshare==0  

. 
. reg pc_fe   `se'  `c' [aweight=prfesq], robust  
(sum of wgt is   1.0301e+05)

Linear regression                               Number of obs     =        110
                                                F(4, 105)         =       8.82
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2716
                                                Root MSE          =     .07011

-------------------------------------------------------------------------------
              |               Robust
        pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
       sepcfe |   .1315096   .6265549     0.21   0.834    -1.110833    1.373852
              |
         xkey |
         Key  |    .243985   .0472228     5.17   0.000      .150351    .3376191
              |
xkey#c.sepcfe |
         Key  |  -6.026237   1.226026    -4.92   0.000    -8.457219   -3.595254
              |
         year |   .0069106   .0026898     2.57   0.012     .0015773    .0122439
        _cons |  -13.87634   5.415615    -2.56   0.012    -24.61451   -3.138179
-------------------------------------------------------------------------------

. est sto m4

. 
. 
. 
. 
. // Models 5-8
. local c if dvshare==1  

. 
. reg pc_fe sepcfe   `c' [aweight=prfesq], robust
(sum of wgt is   1.2301e+05)

Linear regression                               Number of obs     =        119
                                                F(1, 117)         =      10.00
                                                Prob > F          =     0.0020
                                                R-squared         =     0.0630
                                                Root MSE          =       .061

------------------------------------------------------------------------------
             |               Robust
       pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      sepcfe |   1.084446   .3428834     3.16   0.002     .4053833    1.763508
       _cons |  -.0004242   .0099992    -0.04   0.966    -.0202272    .0193787
------------------------------------------------------------------------------

. est sto m5

. 
. local se c.sepcfe##i.xkey

. 
. reg pc_fe   `se'  `c' [aweight=prfesq], robust
(sum of wgt is   1.2301e+05)

Linear regression                               Number of obs     =        119
                                                F(3, 115)         =      17.49
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2752
                                                Root MSE          =     .05412

-------------------------------------------------------------------------------
              |               Robust
        pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
       sepcfe |  -.1865202   .3293727    -0.57   0.572    -.8389441    .4659037
              |
         xkey |
         Key  |  -.1050071    .032177    -3.26   0.001    -.1687436   -.0412706
              |
xkey#c.sepcfe |
         Key  |   4.262144   .7806182     5.46   0.000      2.71589    5.808398
              |
        _cons |   .0261692    .009142     2.86   0.005     .0080607    .0442777
-------------------------------------------------------------------------------

. est sto m6

. 
. local d  dvlog develop nonpolity   fectry ldv robust gmm sampyr 

. local se c.sepcfe##i.xkey

. 
. local c if dvshare==1  

. 
. reg pc_fe `d' `se'  `c' [aweight=prfesq], robust        
(sum of wgt is   1.2301e+05)

Linear regression                               Number of obs     =        119
                                                F(11, 107)        =      12.54
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4788
                                                Root MSE          =     .04757

-------------------------------------------------------------------------------
              |               Robust
        pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
        dvlog |   .0106659   .0165731     0.64   0.521    -.0221884    .0435201
      develop |   .0024629   .0103146     0.24   0.812    -.0179845    .0229103
    nonpolity |  -.0441704   .0151078    -2.92   0.004    -.0741199    -.014221
       fectry |  -.0219591    .009114    -2.41   0.018    -.0400266   -.0038916
          ldv |  -.0059545    .013057    -0.46   0.649    -.0318385    .0199295
       robust |   .0046111   .0136093     0.34   0.735    -.0223678    .0315899
          gmm |   .0629466   .0166761     3.77   0.000     .0298882    .0960049
      sampyrs |  -.0003115    .000837    -0.37   0.710    -.0019708    .0013477
       sepcfe |  -.6540165   .4176358    -1.57   0.120    -1.481931    .1738978
              |
         xkey |
         Key  |  -.1049993   .0227594    -4.61   0.000    -.1501171   -.0598815
              |
xkey#c.sepcfe |
         Key  |   3.857207   .6747356     5.72   0.000     2.519622    5.194792
              |
        _cons |   .0760884   .0392673     1.94   0.055    -.0017545    .1539313
-------------------------------------------------------------------------------

. est sto m7

. 
. 
. local se c.sepcfe##i.xkey year

. local c if dvshare==1  

. 
. reg pc_fe   `se'  `c' [aweight=prfesq], robust  
(sum of wgt is   1.2301e+05)

Linear regression                               Number of obs     =        119
                                                F(4, 114)         =      14.22
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2800
                                                Root MSE          =     .05418

-------------------------------------------------------------------------------
              |               Robust
        pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
       sepcfe |  -.2096096   .3399394    -0.62   0.539    -.8830269    .4638077
              |
         xkey |
         Key  |  -.0897731   .0275388    -3.26   0.001    -.1443272    -.035219
              |
xkey#c.sepcfe |
         Key  |   4.175941   .7398417     5.64   0.000     2.710321    5.641562
              |
         year |   .0017802   .0019409     0.92   0.361    -.0020647     .005625
        _cons |  -3.555846   3.904427    -0.91   0.364    -11.29049    4.178794
-------------------------------------------------------------------------------

. est sto m8

. 
. 
. local mtitles 1 2 3 4 5 6 7 8 

. 
. esttab m1 m2 m3 m4 m5 m6 m7 m8 using "table1.tex",   ///
>         b(%9.3f) se(%9.3f) scalars(r2_a) sfmt(%9.2f) label ///
>   compress notes nogaps nolines replace star(* 0.1 ** 0.05 *** 0.01) nonumbers
>  ///
>   title("Conditional publication bias" \label{tab:pub1}) ///
>  mtitles(`mtitles') 
(output written to table1.tex)

.  
. 
. // Marginal effects plots and calculations 
. 
. // Model 2 
.  est restore m2
(results m2 are active now)

.  margins, dydx(sepcfe) at(xkey=(0 1))

Average marginal effects                        Number of obs     =        110
Model VCE    : Robust

Expression   : Linear prediction, predict()
dy/dx w.r.t. : sepcfe

1._at        : xkey            =           0

2._at        : xkey            =           1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
sepcfe       |
         _at |
          1  |  -.5001462   .5302737    -0.94   0.348    -1.551465     .551173
          2  |  -5.221343   1.108571    -4.71   0.000    -7.419193   -3.023492
------------------------------------------------------------------------------

.  marginsplot, yline(0, lpattern(dash) lcolor(gray)) name(g1, replace) title("L
> evel (Model 2)") ///
>         plotopts(msymbol(O) connect(none)) ytitle("Marginal effect std. error"
> )

  Variables that uniquely identify margins: xkey

. 
. // Model 6
.  est restore m6
(results m6 are active now)

.  margins, dydx(sepcfe) at(xkey=(0 1))

Average marginal effects                        Number of obs     =        119
Model VCE    : Robust

Expression   : Linear prediction, predict()
dy/dx w.r.t. : sepcfe

1._at        : xkey            =           0

2._at        : xkey            =           1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
sepcfe       |
         _at |
          1  |  -.1865202   .3293727    -0.57   0.572    -.8389441    .4659037
          2  |   4.075624   .7077276     5.76   0.000     2.673752    5.477496
------------------------------------------------------------------------------

.  marginsplot,yline(0, lpattern(dash) lcolor(gray)) name(g2, replace) title("Sh
> are (Model 6)") ///
>         plotopts(msymbol(O) connect(none)) ytitle("")

  Variables that uniquely identify margins: xkey

.  
. // Model 3
.   est restore m3
(results m3 are active now)

.  margins, dydx(sepcfe) at(xkey=(0 1))

Average marginal effects                        Number of obs     =        110
Model VCE    : Robust

Expression   : Linear prediction, predict()
dy/dx w.r.t. : sepcfe

1._at        : xkey            =           0

2._at        : xkey            =           1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
sepcfe       |
         _at |
          1  |  -.6852243   .4188057    -1.64   0.105    -1.516331    .1458819
          2  |   -7.12893   1.170913    -6.09   0.000    -9.452569   -4.805291
------------------------------------------------------------------------------

.  marginsplot, yline(0, lpattern(dash) lcolor(gray)) name(g3, replace) title("L
> evel (Model 3)") ///
>         plotopts(msymbol(O) connect(none)) ytitle("Marginal effect std. error"
> )

  Variables that uniquely identify margins: xkey

.  
. // Model 7
.  est restore m7
(results m7 are active now)

.  margins, dydx(sepcfe) at(xkey=(0 1))

Average marginal effects                        Number of obs     =        119
Model VCE    : Robust

Expression   : Linear prediction, predict()
dy/dx w.r.t. : sepcfe

1._at        : xkey            =           0

2._at        : xkey            =           1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
sepcfe       |
         _at |
          1  |  -.6540165   .4176358    -1.57   0.120    -1.481931    .1738978
          2  |   3.203191   .5396908     5.94   0.000     2.133316    4.273065
------------------------------------------------------------------------------

.  marginsplot,yline(0, lpattern(dash) lcolor(gray)) name(g4, replace) title("Sh
> are (Model 7)") ///
>         plotopts(msymbol(O) connect(none)) ytitle("")

  Variables that uniquely identify margins: xkey

.   
. // Model 4
.  est restore m4
(results m4 are active now)

.  margins, dydx(sepcfe) at(xkey=(0 1))

Average marginal effects                        Number of obs     =        110
Model VCE    : Robust

Expression   : Linear prediction, predict()
dy/dx w.r.t. : sepcfe

1._at        : xkey            =           0

2._at        : xkey            =           1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
sepcfe       |
         _at |
          1  |   .1315096   .6265549     0.21   0.834    -1.110833    1.373852
          2  |  -5.894727   1.085098    -5.43   0.000    -8.046276   -3.743178
------------------------------------------------------------------------------

.  marginsplot, yline(0, lpattern(dash) lcolor(gray)) name(g5, replace) title("L
> evel (Model 4)") ///
>         plotopts(msymbol(O) connect(none)) ytitle("Marginal effect std. error"
> )

  Variables that uniquely identify margins: xkey

. 
. // Model 8
.   est restore m8
(results m8 are active now)

.  margins, dydx(sepcfe) at(xkey=(0 1))

Average marginal effects                        Number of obs     =        119
Model VCE    : Robust

Expression   : Linear prediction, predict()
dy/dx w.r.t. : sepcfe

1._at        : xkey            =           0

2._at        : xkey            =           1

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
sepcfe       |
         _at |
          1  |  -.2096096   .3399394    -0.62   0.539    -.8830269    .4638077
          2  |   3.966332   .6531053     6.07   0.000     2.672535    5.260128
------------------------------------------------------------------------------

.  marginsplot, yline(0, lpattern(dash) lcolor(gray)) name(g6, replace) title("S
> hare (Model 8)") ///
>         plotopts(msymbol(O) connect(none)) ytitle("")

  Variables that uniquely identify margins: xkey

.  
.  
. graph combine g1 g2 g3 g4 g5 g6, name(g8, replace) imargin(small) row(3) note(
> "Note: 95% confidence interval")

. 
. // Summary statistics for main variables. Table A1.
. 
. local c if dvshare==0   

. local x pc_fe sepcfe xkey  

. sum `x'   `c'

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       pc_fe |        110    -.000733    .1174374  -.4019367   .2246023
      sepcfe |        110    .0423658    .0199968   .0180745   .1289452
        xkey |        110    .5454545    .5002085          0          1

. 
. local c if dvshare==1 

. local x pc_fe sepcfe xkey 

. sum `x'   `c'

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       pc_fe |        119    .0547271    .1141763  -.2156705   .4310165
      sepcfe |        119    .0481251    .0293528   .0153879   .1301764
        xkey |        119    .3361345    .4743829          0          1

. 
. // Tabulation of significance for key and control
. tab sig xkey, col

+-------------------+
| Key               |
|-------------------|
|     frequency     |
| column percentage |
+-------------------+

 Dummy variable |     Democracy key
for statistical |       variable
   significance |   Control        Key |     Total
----------------+----------------------+----------
Not significant |        97         29 |       126 
                |     75.19      29.00 |     55.02 
----------------+----------------------+----------
    Significant |        32         71 |       103 
                |     24.81      71.00 |     44.98 
----------------+----------------------+----------
          Total |       129        100 |       229 
                |    100.00     100.00 |    100.00 


. 
. 
. log close
      name:  <unnamed>
       log:  /Users/ericaowen/Box/meta/Data and Analysis/Data Analysis/_Meta pub
>  bias/Replication files/owenli_log.log
  log type:  text
 closed on:  27 Jan 2020, 11:58:55
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/ericaowen/Box/meta/Data and Analysis/Data Analysis/_Meta pub
>  bias/Replication files/owenli_log.log
  log type:  text
 opened on:  27 Jan 2020, 11:59:02

. 
. // Replication files for "The Conditional Nature of Publication Bias: The Cond
> itional Nature of Publication Bias: A Meta-Regression Analysis" 
.         // by Erica Owen and Quan Li
. // Date: 1/6/2019
. // File author: Erica Owen (ericaowen@pitt.edu)
. // This do file replicates results in supplemental appendix
. 
. // Setwd
. 
. 
. // #0
. // program set-up
. version 13.1

. clear all

. macro drop _all

. set linesize 80

. 
. 
. // Load data
. use "owenli_data.dta", clear

. 
. 
. // Table A1. Summary by study
. 
. 
. sort studyid

. by studyid: egen meant=mean(tstat)

. by studyid: egen mint=min(tstat)

. by studyid: egen maxt=max(tstat)

. by studyid: egen minyr=min(tstart)

. by studyid: egen maxyr=max(tend)

. gen estimate=1 if tstat~=.

. by studyid: egen nmod=total(estimate), missing

. 
. label var meant "Mean"

. label var mint "Min."

. label var maxt "Max."

. label var minyr "Start year"

. label var maxyr "End year"

. label var nmod "\# models"

. 
. estpost tabstat nmod  meant mint maxt minyr maxyr, statistics(mean)  by(studyi
> d) 

Summary statistics: mean
     for variables: nmod meant mint maxt minyr maxyr
  by categories of: studyid

     studyid |   e(nmod)   e(meant)    e(mint)    e(maxt)   e(minyr)   e(maxyr) 
-------------+------------------------------------------------------------------
           1 |         3   1.503749   .0701754     2.8125       1985       2002 
           2 |         2        .56        .49        .63       1981       2005 
           3 |         9   .7999274   .7222222   .8333333       1984       2007 
           4 |         4  -1.101048  -1.627041  -.1064356       1970       2001 
           5 |         6     3.7445      3.741       3.75       1982       2007 
           6 |        11   1.674202  -1.013433   3.366667       1994       2004 
           7 |         6   .1494081  -.0348661   .3201856       1986       2006 
           8 |         2          1          1          1       1980       2003 
           9 |         1   .6153846   .6153846   .6153846       1985       2002 
          10 |         9   .0618024  -5.377862    2.59434       1975       2010 
          13 |         3   2.388778   1.928571   2.692308       1980       2000 
          14 |         3   .3128803  -.0328761   .8082192       1970       2000 
          15 |        11   1.462487  -.8429752   3.097015       1985       2002 
          16 |        11   .5685346      -3.76   5.142857       1982       1995 
          17 |        14  -.2076429     -2.604      2.723       1980       2012 
          18 |         4   1.634485   1.295455    2.42381       1985       2011 
          19 |        13   1.923802       -4.5     4.3611       1982       1999 
          20 |        11  -.5121095  -1.449045   1.704545       1973       2008 
          21 |        18   1.273697  -.0473684        3.4       1972       2008 
          22 |         1     -1.283     -1.283     -1.283       1995       2003 
          23 |        12   2.594167      -2.89       4.84       1984       2001 
          24 |         1      1.855      1.855      1.855       1975       1995 
          25 |        18   1.286444     -3.988      3.669       1990       1997 
          26 |         2      1.445       1.25       1.64       1975       1995 
          27 |         4       .125       .125       .125       1971       2006 
          28 |        10   3.585063   .6397985   4.708333       1987       2006 
          29 |         3         .2       -.25        .75       1970       2007 
          30 |         4    1.57125      1.102      2.072       1969       2000 
          31 |        10     -2.897      -5.47       -.56       1982       1995 
          32 |         8   -2.18125      -3.19       -.11       1982       1995 
          33 |         2  -5.730132  -5.736994   -5.72327       1980       2000 
          34 |         3  -.5619441  -1.459641   1.105518       1996       2007 
          35 |         3   1.840502   .8548387   3.541667       1981       2002 
          36 |         1   .0130435   .0130435   .0130435       1980       2003 
          37 |         2         .4        -.2          1       1986       2002 
          40 |         4   1.780709    1.15126   2.557895       1996       2007 
-------------+------------------------------------------------------------------
       Total |  10.03057   .8062555  -1.603285   2.550862   1981.738   2003.162 

category labels saved in macro e(labels)

. 
. esttab . using "table_a1.tex",   cells("nmod  meant(fmt(%9.3f)) mint(fmt(%9.3f
> )) maxt(fmt(%9.3f)) minyr maxyr") replace ///
>         varlabels(`e(labels)') 
(output written to table_a1.tex)

.         
. // Figure 1: Distribution of partial correlations
. 
. sort dvshare pc_fe

. egen rank_pc=rank(pc_fe), by(dvshare)

. label var rank_pc "Partial correlation rank"

. gen tcrit=.
(229 missing values generated)

. forvalues i=58/100 {
  2.         replace tcrit=invttail(`i',0.025) if df==`i'
  3.         }
(1 real change made)
(7 real changes made)
(0 real changes made)
(0 real changes made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(1 real change made)
(0 real changes made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)

.         
. replace tcrit=invttail(101,0.025) if df>100 & df~=.
(215 real changes made)

. gen lb=pc_fe-(tcrit*sepcfe)

. gen ub=pc_fe+(tcrit*sepcfe)

. 
. graph twoway (rspike lb ub rank_pc if dvshare==0, lwidth(thin)) ///
>         (scatter pc_fe rank_pc if dvshare==0 & xkey==0, msymbol(o)) ///
>         (scatter pc_fe rank_pc if dvshare==0 & xkey==1, mcolor(red) msymbol(t)
> ), ///
>         legend(pos(4) ring(0) order(2 3) row(1) label(2 "Control") label(3 "Ke
> y")) ///
>         yline(0, lcolor(gray) lwidth(thin)) name(g1, replace)  ytitle("Partial
>  correlation") ///
>                 xlabel(0(10)110)

. graph twoway (rspike lb ub rank_pc if dvshare==1, lwidth(thin)) ///
>  (scatter pc_fe rank_pc if dvshare==1 & xkey==0, msymbol(o)) ///
>         (scatter pc_fe rank_pc if dvshare==1 & xkey==1, mcolor(red) msymbol(t)
> ), ///
>         legend(pos(4) ring(0) order(2 3) row(1) label(2 "Control") label(3 "Ke
> y")) ///
>         yline(0, lcolor(gray)) name(g2, replace)   ytitle("Partial correlation
> ") ///
>         xlabel(0(10)120)

.         
.         
. // Table A2: Summary statistics for all variables
. 
. local c if dvshare==0  

. local x pc_fe sepcfe xkey dvlog develop nonpolity   fectry ldv robust gmm samp
> yr   year

. sum `x'   `c'

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       pc_fe |        110    -.000733    .1174374  -.4019367   .2246023
      sepcfe |        110    .0423658    .0199968   .0180745   .1289452
        xkey |        110    .5454545    .5002085          0          1
       dvlog |        110    .5909091    .4939163          0          1
     develop |        110    .8363636    .3716384          0          1
-------------+---------------------------------------------------------
   nonpolity |        110    .0818182    .2753419          0          1
      fectry |        110    .3181818    .4679022          0          1
         ldv |        110    .3363636    .4746273          0          1
      robust |        110          .6    .4921401          0          1
         gmm |        110    .1181818    .3243007          0          1
-------------+---------------------------------------------------------
     sampyrs |        110    17.65455    6.411624          9         36
        year |        110    2010.227    3.623722       2003       2016

. sutex `x'   `c', minmax labels file(table_a2_flow) replace digits(2)
file table_a2_flow.tex saved

. 
. local c if dvshare==1  

. local x pc_fe sepcfe xkey dvlog develop nonpolity   fectry ldv robust gmm samp
> yr  year

. sum `x'   `c'

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       pc_fe |        119    .0547271    .1141763  -.2156705   .4310165
      sepcfe |        119    .0481251    .0293528   .0153879   .1301764
        xkey |        119    .3361345    .4743829          0          1
       dvlog |        119    .0420168    .2014758          0          1
     develop |        119    .6218487    .4869761          0          1
-------------+---------------------------------------------------------
   nonpolity |        119    .2941176    .4575717          0          1
      fectry |        119    .5210084    .5016708          0          1
         ldv |        119    .5798319    .4956728          0          1
      robust |        119    .6470588    .4799053          0          1
         gmm |        119    .1008403    .3023904          0          1
-------------+---------------------------------------------------------
     sampyrs |        119    23.47059    10.32179          6         38
        year |        119    2010.546    4.143093       2003       2015

. sutex `x'   `c', minmax labels file(table_a2_share) replace digits(2)
file table_a2_share.tex saved

. 
. 
. // Table A3: alternative measure of pub bias
. 
. 
. 
. local i insqrtn

. 
. // Level 
. local c if dvshare==0  

. local se c.`i'##i.xkey

. 
. reg pc_fe c.`i' i.xkey `c' [aweight=prfesq], robust
(sum of wgt is   1.0301e+05)

Linear regression                               Number of obs     =        110
                                                F(2, 107)         =       8.89
                                                Prob > F          =     0.0003
                                                R-squared         =     0.1501
                                                Root MSE          =     .07502

------------------------------------------------------------------------------
             |               Robust
       pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     insqrtn |  -2.551328   .6311637    -4.04   0.000    -3.802537    -1.30012
             |
        xkey |
        Key  |   .0002639   .0157524     0.02   0.987    -.0309634    .0314912
       _cons |   .1081794   .0194273     5.57   0.000      .069667    .1466918
------------------------------------------------------------------------------

. est sto m1

. 
. reg pc_fe   `se'  `c' [aweight=prfesq], robust
(sum of wgt is   1.0301e+05)

Linear regression                               Number of obs     =        110
                                                F(3, 106)         =       8.21
                                                Prob > F          =     0.0001
                                                R-squared         =     0.2492
                                                Root MSE          =     .07084

------------------------------------------------------------------------------
             |               Robust
       pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     insqrtn |  -.4637342   .5625243    -0.82   0.412    -1.578993    .6515249
             |
        xkey |
        Key  |    .163638    .043627     3.75   0.000     .0771432    .2501328
             |
        xkey#|
   c.insqrtn |
        Key  |  -4.934038   1.247122    -3.96   0.000    -7.406578   -2.461497
             |
       _cons |    .055334   .0176844     3.13   0.002     .0202729    .0903951
------------------------------------------------------------------------------

. est sto m2

. 
. local d  dvlog develop nonpolity   fectry ldv robust gmm sampyr 

. 
. reg pc_fe `d' `se'  `c' [aweight=prfesq], robust        
(sum of wgt is   1.0301e+05)

Linear regression                               Number of obs     =        110
                                                F(11, 98)         =      37.29
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7174
                                                Root MSE          =      .0452

------------------------------------------------------------------------------
             |               Robust
       pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       dvlog |   .0646317   .0159349     4.06   0.000     .0330094    .0962539
     develop |   .0213578   .0149743     1.43   0.157    -.0083582    .0510739
   nonpolity |   .0100795   .0176839     0.57   0.570    -.0250136    .0451725
      fectry |   .0331177   .0170197     1.95   0.055    -.0006572    .0668927
         ldv |   .0593554   .0205406     2.89   0.005     .0185933    .1001175
      robust |  -.0342317    .009137    -3.75   0.000    -.0523639   -.0160996
         gmm |   .1233934   .0512936     2.41   0.018     .0216029    .2251839
     sampyrs |  -.0090086   .0012471    -7.22   0.000    -.0114835   -.0065337
     insqrtn |  -.7459174   .4286882    -1.74   0.085    -1.596635    .1048004
             |
        xkey |
        Key  |   .1949209   .0490177     3.98   0.000     .0976469    .2921949
             |
        xkey#|
   c.insqrtn |
        Key  |  -6.679844   1.050407    -6.36   0.000    -8.764343   -4.595345
             |
       _cons |   .1670811    .030243     5.52   0.000     .1070649    .2270973
------------------------------------------------------------------------------

. est sto m3

. 
. 
. 
. reg pc_fe   `se' year `c' [aweight=prfesq], robust      
(sum of wgt is   1.0301e+05)

Linear regression                               Number of obs     =        110
                                                F(4, 105)         =       9.41
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2845
                                                Root MSE          =     .06948

------------------------------------------------------------------------------
             |               Robust
       pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     insqrtn |   .2349419   .6678706     0.35   0.726    -1.089322    1.559206
             |
        xkey |
        Key  |    .256248   .0478378     5.36   0.000     .1613944    .3511016
             |
        xkey#|
   c.insqrtn |
        Key  |  -6.343183   1.253216    -5.06   0.000     -8.82808   -3.858286
             |
        year |   .0072005   .0026474     2.72   0.008     .0019511    .0124499
       _cons |   -14.4627    5.33041    -2.71   0.008    -25.03192   -3.893481
------------------------------------------------------------------------------

. est sto m4

. 
. 
. 
. 
. // Share
. local c if dvshare==1  

. local se c.`i'##i.xkey

. 
. reg pc_fe c.`i' i.xkey `c' [aweight=prfesq], robust
(sum of wgt is   1.2301e+05)

Linear regression                               Number of obs     =        119
                                                F(2, 116)         =       6.84
                                                Prob > F          =     0.0016
                                                R-squared         =     0.0957
                                                Root MSE          =     .06019

------------------------------------------------------------------------------
             |               Robust
       pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     insqrtn |   .9937501   .3636777     2.73   0.007     .2734405     1.71406
             |
        xkey |
        Key  |   .0244517   .0171369     1.43   0.156    -.0094901    .0583935
       _cons |  -.0042475   .0100045    -0.42   0.672    -.0240626    .0155677
------------------------------------------------------------------------------

. est sto m5

. 
. reg pc_fe   `se'  `c' [aweight=prfesq], robust
(sum of wgt is   1.2301e+05)

Linear regression                               Number of obs     =        119
                                                F(3, 115)         =      20.55
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2844
                                                Root MSE          =     .05377

------------------------------------------------------------------------------
             |               Robust
       pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     insqrtn |  -.1963937   .3427154    -0.57   0.568    -.8752469    .4824595
             |
        xkey |
        Key  |  -.1090447   .0316815    -3.44   0.001    -.1717997   -.0462897
             |
        xkey#|
   c.insqrtn |
        Key  |   4.397496   .7602845     5.78   0.000     2.891519    5.903474
             |
       _cons |   .0263958   .0093494     2.82   0.006     .0078764    .0449153
------------------------------------------------------------------------------

. est sto m6

. 
. local d  dvlog develop nonpolity   fectry ldv robust gmm sampyr 

. 
. reg pc_fe `d' `se'  `c' [aweight=prfesq], robust        
(sum of wgt is   1.2301e+05)

Linear regression                               Number of obs     =        119
                                                F(11, 107)        =      13.82
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4864
                                                Root MSE          =     .04723

------------------------------------------------------------------------------
             |               Robust
       pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       dvlog |   .0107094   .0164265     0.65   0.516    -.0218542    .0432729
     develop |   .0027842    .010264     0.27   0.787     -.017563    .0231313
   nonpolity |  -.0439923   .0150015    -2.93   0.004     -.073731   -.0142536
      fectry |  -.0216815   .0090353    -2.40   0.018     -.039593     -.00377
         ldv |   -.005388   .0129324    -0.42   0.678     -.031025     .020249
      robust |   .0049551   .0134455     0.37   0.713    -.0216991    .0316093
         gmm |   .0624849    .016436     3.80   0.000     .0299024    .0950674
     sampyrs |  -.0003262   .0008371    -0.39   0.698    -.0019856    .0013332
     insqrtn |    -.68511   .4358987    -1.57   0.119    -1.549228    .1790083
             |
        xkey |
        Key  |   -.109957   .0219125    -5.02   0.000     -.153396    -.066518
             |
        xkey#|
   c.insqrtn |
        Key  |   4.018101   .6541895     6.14   0.000     2.721246    5.314955
             |
       _cons |   .0762342   .0391563     1.95   0.054    -.0013885     .153857
------------------------------------------------------------------------------

. est sto m7

. 
. 
. 
. reg pc_fe   `se' year `c' [aweight=prfesq], robust      
(sum of wgt is   1.2301e+05)

Linear regression                               Number of obs     =        119
                                                F(4, 114)         =      16.73
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2887
                                                Root MSE          =     .05384

------------------------------------------------------------------------------
             |               Robust
       pc_fe |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     insqrtn |  -.2192891   .3531208    -0.62   0.536    -.9188187    .4802405
             |
        xkey |
        Key  |    -.09445   .0266174    -3.55   0.001    -.1471789   -.0417212
             |
        xkey#|
   c.insqrtn |
        Key  |   4.313172   .7168561     6.02   0.000     2.893086    5.733259
             |
        year |    .001697    .001925     0.88   0.380    -.0021163    .0055103
       _cons |  -3.388259   3.872431    -0.87   0.383    -11.05951    4.282998
------------------------------------------------------------------------------

. est sto m8

. 
. 
. local mtitles 1 2 3 4 5 6 7 8 

. 
. esttab m1 m2 m3 m4 m5 m6 m7 m8 using "tablea3.tex",   ///
>         b(%9.3f) se(%9.3f) scalars(r2_a) sfmt(%9.2f) label ///
>   compress notes nogaps nolines replace star(* 0.1 ** 0.05 *** 0.01) nonumbers
>  ///
>   title("Alternative measure of publication bias" \label{tab:pub2}) ///
>  mtitles(`mtitles') nobaselevels 
(output written to tablea3.tex)

. 
.  
. log close
      name:  <unnamed>
       log:  /Users/ericaowen/Box/meta/Data and Analysis/Data Analysis/_Meta pub
>  bias/Replication files/owenli_log.log
  log type:  text
 closed on:  27 Jan 2020, 11:59:06
--------------------------------------------------------------------------------
